home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NeXTSTEP 3.1 (Developer) [x86]
/
NeXT Step 3.1 Intel dev.cdr.dmg
/
NextDeveloper
/
Examples
/
AppKit
/
Draw
/
graphicsUndo.subproj
/
ReorderGraphicsChange.m
< prev
next >
Wrap
Text File
|
1992-02-09
|
888b
|
47 lines
#import "drawundo.h"
@interface ReorderGraphicsChange(PrivateMethods)
- undoDetails;
@end
@implementation ReorderGraphicsChange
- saveBeforeChange
{
[super saveBeforeChange];
[changeDetails makeObjectsPerform:@selector(recordGraphicPositionIn:) with:[graphicView graphics]];
return self;
}
- changeDetailClass
{
return [OrderChangeDetail class];
}
- undoDetails
{
int count, i;
id detail, graphic;
List *allGraphics;
count = [changeDetails count];
allGraphics = [graphicView graphics];
for (i = 0; i < count; i++) {
detail = [changeDetails objectAt:i];
graphic = [detail graphic];
[allGraphics removeObject:graphic];
}
for (i = 0; i < count; i++) {
detail = [changeDetails objectAt:i];
graphic = [detail graphic];
[allGraphics insertObject:graphic at:[detail graphicPosition]];
}
return self;
}
@end